package com.zly.solon.controller;

import com.baomidou.mybatisplus.solon.plugins.pagination.Page;
import com.zly.solon.entity.User;
import com.zly.solon.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.solon.annotation.Db;
import org.noear.solon.annotation.*;

@Slf4j
@Mapping("/user")
@Controller
public class UserController {
    @Db(value = "db1")
    private UserService userService;
    @Mapping("/plus")
    public Page<User> plus(@Param(defaultValue = "1") Integer current, @Param(defaultValue = "10") Integer size){
        log.info("current: {},size: {}",current,size);
        Page<User> objectPage = new Page<>(current, size);
        return userService.page(objectPage,null);
    }
}
